import {getOrderList} from '../../../services/order_service';
import {SET_ORDER_LIST} from './action_types';

const setOrderList = data=>{
  return {
    type: SET_ORDER_LIST,
    orderListData: data
  }
};
export const getOrderListData = (data)=>{
  return async dispatch => {
    const list = await getOrderList(data);
    list.result.forEach(item=>{
      item.key = item.id;
    });
    dispatch(setOrderList(list));
  }
};
